#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QToolBar>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QMenuBar *menuBar = this->menuBar();
    this->setMenuBar(menuBar);

    QToolBar *toolBar1 = new QToolBar();
    QToolBar *toolBar2 = new QToolBar();

    this->addToolBar(toolBar1);
    this->addToolBar(Qt::LeftToolBarArea,toolBar2);

    toolBar1->setMovable(false);

    toolBar2->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
    toolBar2->setFloatable(false);

    QAction *action1 = new QAction("save");
    QAction *action2 = new QAction("hide");


    QAction *action3 = new QAction("save");
    QAction *action4 = new QAction("hide");

    toolBar2->addAction(action3);
    toolBar2->addAction(action4);

    action1->setToolTip("保存文件");

    menuBar->addAction(action1);
    menuBar->addAction(action2);

    toolBar1->addAction(action1);
    toolBar1->addAction(action2);

    action1->setIcon(QIcon(":/1.jpg"));

}

MainWindow::~MainWindow()
{
    delete ui;
}

